package com.skyform.teraproc.cloudlogic.plugin.mcloud;

import java.io.IOException;
import java.util.*;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * Created by Javen on 14-8-18.
 */
@SuppressWarnings("all")
public class McloudCache {
	private static final Log log = LogFactory.getLog(McloudCache.class);
	

    private static final McloudCache instance = new McloudCache();

    private McloudCache(){
    	log.error("11111111");
        Timer timer = new Timer();
        timer.schedule(new TimerTask() {
            @Override
            public void run() {
            	log.error("000000000000");
                instance.refreshTemplateCache();
                log.error("22222222222");
                instance.refreshServiceOfferingsCache();
                log.error("3333333");
                instance.refreshResourcePoolCache();
                log.error("4444444444444");
                instance.refreshZoneCache();
                log.error("5555555555555");
                instance.refreshDiskOfferingsCache();
                log.error("66666666666666");
            }
        },0,5*1000);
    }

    public List getTemplateCache(String resourcePoolId) {
        return null;
    }

    public List getPoolCache() {
        return null;
    }

    public List getServiceOfferingsCache(String resourcePoolId) {
        return null;
    }

    public List getZoneCache(String resourcePoolId) {
		return null;
	}

	public List getDiskOfferingsCache(String resourcePoolId) {
		return null;
	}

	public static McloudCache getInstance () {
        return instance;
    }

    public void refreshTemplateCache() {
    	log.error("1-->1111111111");
    	int i = 1/0;
        log.error("1-->4444444444444");
    }

    public void refreshResourcePoolCache() {

       
    }

    public void refreshServiceOfferingsCache() {
       
    }
    
    public void refreshZoneCache() {
    }
    
    public void refreshDiskOfferingsCache() {
    }


    public static void main(String[] args) {
    	McloudCache.getInstance();
    }

}
